﻿<!DOCTYPE html>
<!--试题选项编辑-->
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>


</head>

<body>


    <div id="app" v-cloak class="popupW150">

        <el-form label-position="right" :model="Form" status-icon :rules="rules" ref="ruleForm" label-width="140px"
            size="mini">
            <el-row>
                <el-col :span="24">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input type="text" v-model="Form.OptionName" autocomplete="off" size="mini">
                                <template slot="prepend">
                                    {{TestQuestionsOption.OptionName+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :span="24">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <div class="el-input--mini el-input-group">
                                <div class="el-input-group__prepend">
                                    {{TestQuestionsOption.OptionComment+mark.m}}
                                </div>
                                <el-input class="el-textarea__inner" type="textarea" v-model="Form.OptionComment"
                                    autocomplete="off"></el-input>
                            </div>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :sqpn="11">
                    <el-form-item :label="TestQuestionsOption.IsAnswer+mark.m" prop="IsConsumables">
                        <el-radio-group v-model="Form.IsAnswer" style="margin-top:5px">
                            <el-radio v-for="item in IsAnswer" :label="item.value" :value="item.key">{{item.value}}
                            </el-radio>
                        </el-radio-group>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row type="flex" justify="end">
                <el-form-item>
                    <el-button type="primary" @click="onSubmitForm">{{col.btnConfirm}}</el-button>
                    <el-button type="primary" @click="parent.ListItem.dialogVisible=false">{{col.btnBack}}</el-button>
                </el-form-item>
            </el-row>
        </el-form>
    </div>
    <script type="text/javascript">
        var app = new Vue({
            el: '#app',
            data: {
                //父业传参
                id: '',
                //业务表单内容
                Form: {
                    OptionName: '',
                    OptionComment: '',
                    IsAnswer: '否',
                },
                IsAnswer: [{ key: '是', value: '是' },
                    { key: '是', value: '否' }],
                //表单验证
                rules: {
                    OptionName: [
                        verification.NotNull
                    ],
                    OptionComment: [
                        verification.NotNull
                    ]
                }
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                //提交数据
                onSubmitForm: function () {
                    var OptionName = this.Form.OptionName;
                    var OptionComment = this.Form.OptionComment;

                    parent.app.Form.cbS_QuestionsOptions.push({
                        optionName: OptionName,
                        optionComment: OptionComment,
                        isAnswer: this.Form.IsAnswer
                    });
                    parent.app.ListItem.dialogVisible = false;
                }
            },
            mounted: function () {
                //this.IsAnswer = getDicData('50');

            },
        });
    </script>
</body>

</html>